#include <stdio.h>
#include <my_global.h>
#include <mysql.h>
int main(void)
{
	MYSQL omaKanta;
	//MYSQL_RES *tulos;
	//MYSQL_ROW rivi;

	mysql_library_init( 0, NULL, NULL );
	mysql_init( &omaKanta );

	printf("Connecting...\n");
	if (!mysql_real_connect( &omaKanta, "127.0.0.1", "root", "Koodaus1", "Temperature", 0, NULL, 0 ))	{
		printf("Connection lost.\n");
	} else	{
		printf("Connected.\n");
	}

	
	if (mysql_query(&omaKanta, "use Temperature;"))
	{
		printf ("Database unusable.\n");
	} else {
		printf ("OK.\n");
	}

	return 0;
}

